package ui;

import ui.label.LimpidLabel;
import ui.panel.WorkPanel;
import utils.CommonUtil;
import utils.ImageUtils;

import javax.swing.*;
import java.io.IOException;

public class PetResourceMaker extends JFrame {

    private static JFrame main = new JFrame("PetResourceMaker");

    public PetResourceMaker() throws IOException {
        JPanel contentPane = (JPanel) main.getContentPane();
        contentPane.setOpaque(false);
        contentPane.setLayout(null);
        //初始化工作区
        WorkPanel workPanel = new WorkPanel();
        contentPane.add(workPanel);
        contentPane.add(WorkPanel.bg);
        //初始化图形界面
        main.setSize(900, 500);
        main.setLocation((CommonUtil.screenWidth -900)/2, (CommonUtil.screenHeight-500)/2);
        //添加背景
        main.add(new LimpidLabel(ImageUtils.bg,0, 0, 900, 500));
        //设置图标
        main.setIconImage(ImageUtils.logo);
        main.setDefaultCloseOperation(EXIT_ON_CLOSE);
        main.setVisible(true);
        main.repaint();
    }

}
